<!--<script setup lang="ts">-->
<!--import HelloWorld from './components/HelloWorld.vue'-->
<!--import {message} from "ant-design-vue";-->
<!--import Map from "./components/Map.vue";-->
<!--const doClick = () => {-->

<!--  message.success("123")-->
<!--  console.log('点击了')-->
<!--}-->
<!--const nodes={-->
<!--  nodeList:[-->
<!--    {longitude:116.39,latitude:39.9},-->
<!--    {longitude:118.39,latitude:29.9},-->
<!--  ],-->
<!--  style:{-->
<!--    lineColor:"blue",-->
<!--    lineWidth:2,-->
<!--  }-->
<!--}-->

<!--const text={-->
<!--  text:'hello',-->
<!--  points:{longitude: 117.397428, latitude: 36.90923},-->
<!--  style: {-->
<!--    font:'26px Arial, sans-serif',-->
<!--    fillColor:'yellow',-->
<!--    strokeColor:'red',-->
<!--    strokeWidth:4,-->
<!--  }-->
<!--}-->
<!--</script>-->

<!--<template>-->
<!--    <a-button type="primary" @click="doClick" danger>点击我</a-button>-->
<!--&lt;!&ndash;  <HelloWorld msg="Vite + Vue" />&ndash;&gt;-->
<!--  <div style="width: 1600px;height: 800px;border: 3px solid #ccc000;margin: 0 auto 50px;">-->
<!--&lt;!&ndash;    <MyMap :nodes="nodes"></MyMap>&ndash;&gt;-->
<!--    <Map :nodes="nodes" :text="text"></Map>-->
<!--  </div>-->
<!--</template>-->

<template>
  <div id="app">
    <template v-if="currentProject.name!=null">
      <BasicLayout></BasicLayout>
    </template>
    <template v-else>
      <ProjectLayout />
    </template>
  </div>
</template>
<script setup>
import ProjectLayout from "./layouts/ProjectLayout.vue";
import { onMounted } from "vue";
import {useRoute,useRouter} from "vue-router";
import {message} from "ant-design-vue";
import useProject from "./store/project.js";
import {storeToRefs} from "pinia";
import BasicLayout from "./layouts/BasicLayout.vue";


const {currentProject}=storeToRefs(useProject());
// console.log("currentProject",currentProject.value)
// if (currentProject.value.name==null){
//   console.log("111111111111")
// }

const route=useRoute()
const router=useRouter()

/**
 * 全局初始化函数，有全局单次调用的代码，都可以写到这里
 */
const doInit = () => {
  // console.log(route)

};

onMounted(() => {
  doInit();
  if (currentProject.value.name==null){
    router.push({path:'/'})
    message.success("请选择项目");

  }
});

</script>
<style></style>
